package com.blockmeta.bbs.immodule.greendao.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.blockmeta.bbs.immodule.dao.ChatMessage;
import com.blockmeta.bbs.immodule.dao.CircleMember;
import com.blockmeta.bbs.immodule.dao.IMUserEntity;
import com.blockmeta.bbs.immodule.dao.TalkListTop;
import com.blockmeta.bbs.immodule.dao.Todo;
import com.blockmeta.bbs.immodule.greendao.CollectionBean;

import com.blockmeta.bbs.immodule.greendao.db.ChatMessageDao;
import com.blockmeta.bbs.immodule.greendao.db.CircleMemberDao;
import com.blockmeta.bbs.immodule.greendao.db.IMUserEntityDao;
import com.blockmeta.bbs.immodule.greendao.db.TalkListTopDao;
import com.blockmeta.bbs.immodule.greendao.db.TodoDao;
import com.blockmeta.bbs.immodule.greendao.db.CollectionBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig chatMessageDaoConfig;
    private final DaoConfig circleMemberDaoConfig;
    private final DaoConfig iMUserEntityDaoConfig;
    private final DaoConfig talkListTopDaoConfig;
    private final DaoConfig todoDaoConfig;
    private final DaoConfig collectionBeanDaoConfig;

    private final ChatMessageDao chatMessageDao;
    private final CircleMemberDao circleMemberDao;
    private final IMUserEntityDao iMUserEntityDao;
    private final TalkListTopDao talkListTopDao;
    private final TodoDao todoDao;
    private final CollectionBeanDao collectionBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        chatMessageDaoConfig = daoConfigMap.get(ChatMessageDao.class).clone();
        chatMessageDaoConfig.initIdentityScope(type);

        circleMemberDaoConfig = daoConfigMap.get(CircleMemberDao.class).clone();
        circleMemberDaoConfig.initIdentityScope(type);

        iMUserEntityDaoConfig = daoConfigMap.get(IMUserEntityDao.class).clone();
        iMUserEntityDaoConfig.initIdentityScope(type);

        talkListTopDaoConfig = daoConfigMap.get(TalkListTopDao.class).clone();
        talkListTopDaoConfig.initIdentityScope(type);

        todoDaoConfig = daoConfigMap.get(TodoDao.class).clone();
        todoDaoConfig.initIdentityScope(type);

        collectionBeanDaoConfig = daoConfigMap.get(CollectionBeanDao.class).clone();
        collectionBeanDaoConfig.initIdentityScope(type);

        chatMessageDao = new ChatMessageDao(chatMessageDaoConfig, this);
        circleMemberDao = new CircleMemberDao(circleMemberDaoConfig, this);
        iMUserEntityDao = new IMUserEntityDao(iMUserEntityDaoConfig, this);
        talkListTopDao = new TalkListTopDao(talkListTopDaoConfig, this);
        todoDao = new TodoDao(todoDaoConfig, this);
        collectionBeanDao = new CollectionBeanDao(collectionBeanDaoConfig, this);

        registerDao(ChatMessage.class, chatMessageDao);
        registerDao(CircleMember.class, circleMemberDao);
        registerDao(IMUserEntity.class, iMUserEntityDao);
        registerDao(TalkListTop.class, talkListTopDao);
        registerDao(Todo.class, todoDao);
        registerDao(CollectionBean.class, collectionBeanDao);
    }
    
    public void clear() {
        chatMessageDaoConfig.clearIdentityScope();
        circleMemberDaoConfig.clearIdentityScope();
        iMUserEntityDaoConfig.clearIdentityScope();
        talkListTopDaoConfig.clearIdentityScope();
        todoDaoConfig.clearIdentityScope();
        collectionBeanDaoConfig.clearIdentityScope();
    }

    public ChatMessageDao getChatMessageDao() {
        return chatMessageDao;
    }

    public CircleMemberDao getCircleMemberDao() {
        return circleMemberDao;
    }

    public IMUserEntityDao getIMUserEntityDao() {
        return iMUserEntityDao;
    }

    public TalkListTopDao getTalkListTopDao() {
        return talkListTopDao;
    }

    public TodoDao getTodoDao() {
        return todoDao;
    }

    public CollectionBeanDao getCollectionBeanDao() {
        return collectionBeanDao;
    }

}
